# Mainline OpenSBI supports the C906 out of the box, but it needs a few tweaks
# and a new reset driver for the sunxi watchdog.

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

#SRCREV = "efbc2b8c7372067622d4169cf59378fd58fe3ec3"

#SRC_URI = "git://github.com/Cezarus27/opensbi.git;protocol=https;branch=d1-wip
#           file://0001-Makefile-Don-t-specify-mabi-or-march.patch
#          "

#EXTRA_OEMAKE += "CROSS_COMPILE=${TARGET_PREFIX} FW_PIC=y"

#do_install() {
#    autotools_do_install
#}

#INSANE_SKIP:${PN} += "ldflags"

#EXTRA_OEMAKE:remove = "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=n CLANG_TARGET= "
#EXTRA_OEMAKE:append = "PLATFORM=${RISCV_SBI_PLAT} I=${D} FW_PIC=y CLANG_TARGET= "

#do_deploy () {
#    install -d ${DEPLOYDIR}/opensbi
#	install -m 0755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_payload.* ${DEPLOYDIR}/opensbi
#	install -m 0755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_jump.* ${DEPLOYDIR}/opensbi
#	install -m 0755 ${D}/share/opensbi/*/${RISCV_SBI_PLAT}/firmware/fw_dynamic.* ${DEPLOYDIR}/opensbi
#}

SRC_URI += "file://fw_jump-org.bin"

do_deploy:append() {
    install -d ${DEPLOYDIR}
    install -m 0644 ${WORKDIR}/fw_jump-org.bin ${DEPLOYDIR}/fw_jump-org.bin
}
